home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
Small Eiffel 0.4.8
/
lib_std
/
memory.e
< prev
next >
Wrap
Text File
|
1997-04-13
|
2KB
|
85 lines
-- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
-- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
--
expanded class MEMORY
--
-- Facilities for tuning up the garbage collection, and
-- everything about memory control.
--
inherit PLATFORM;
feature -- Status Report :
frozen collecting: BOOLEAN is
-- Is garbage collection enabled ?
do
not_yet_implemented;
end;
feature -- Status setting :
frozen collection_off is
-- Disable garbage collection.
do
not_yet_implemented;
end;
frozen collection_on is
-- Enable garbage collection.
do
not_yet_implemented;
end;
feature -- Removal :
dispose is
-- Action to be executed just before garbage collection
-- reclaims an object.
do
end;
frozen full_collect is
-- Force a full collection cycle if garbage collection is
-- enabled; do nothing otherwise.
do
end;
feature -- The Guru section (low level memory management) :
pointer_size: INTEGER is
-- The size in number of bytes for a pointer.
external "CSE"
end;
malloc(size: INTEGER): POINTER is
-- Memory allocation of `size' byte.
require
size > 0
external "IC"
end;
calloc(number_of_objects, size_of_one: INTEGER): POINTER is
-- Memory allocation of `size' byte.
require
number_of_objects > 0;
size_of_one >= 1
external "IC"
end;
realloc(pointer: POINTER; size: INTEGER): POINTER is
-- Memory re-allocation of `size' byte.
require
pointer.is_not_void;
size > 0
external "IC"
end;
free(pointer: POINTER) is
require
pointer.is_not_void;
external "IC"
end;
end -- MEMORY